package com.wcl.nullmusic.utils;

import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.widget.ProgressBar;

import com.wcl.nullmusic.base.BaseAppcation;

/**
 * Created by dllo on 16/1/19.
 */
public class ProgressBarUtils {
    private static ProgressBarUtils utils;
    private static ProgressDialog dialog;

    private ProgressBarUtils() {
    }

    public static ProgressBarUtils getInstance() {
        if (utils == null) {
            utils = new ProgressBarUtils();
        }
        return utils;
    }

    public static void showProgressDialog(Context context) {
        if (dialog == null)
            dialog = new ProgressDialog(context);
        dialog.setTitle("数据正在加载中");
        dialog.setMessage("Loading...");
        dialog.show();
    }

    public static void dismissProgressDialog() {
        dialog.dismiss();
        dialog=null;
    }
}
